﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Data;

namespace Frame.Lib.Core.Log.Login
{
    public partial class LogLoginInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "s_LogLogin";
        }
        public override string GetInsertSql()
        {
            return "insert into s_LogLogin ( [ID], [UserID], [UserName], [LoginName], [InputTime], [IP], [Result]) values ( @ID, @UserID, @UserName, @LoginName, @InputTime, @IP, @Result)";
        }
        public override string GetUpdateSql()
        {
            return "update s_LogLogin set [UserID] = @UserID, [UserName] = @UserName, [LoginName] = @LoginName, [InputTime] = @InputTime, [IP] = @IP, [Result] = @Result where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        public Guid ID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32? UserID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String UserName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String LoginName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String IP
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 Result
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Guid)value;
                    break;
                case "userid":
                    this.UserID = (Int32?)value;
                    break;
                case "username":
                    this.UserName = (String)value;
                    break;
                case "loginname":
                    this.LoginName = (String)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "ip":
                    this.IP = (String)value;
                    break;
                case "result":
                    this.Result = (Int32)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "userid":
                    return this.UserID;
                case "username":
                    return this.UserName;
                case "loginname":
                    return this.LoginName;
                case "inputtime":
                    return this.InputTime;
                case "ip":
                    return this.IP;
                case "result":
                    return this.Result;
                default:
                    return null;
            }
        }
    }

}
